<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
	  xmlns:ui="http://java.sun.com/jsf/facelets"
	  xmlns:p="http://primefaces.org/ui"
	  xmlns:f="http://java.sun.com/jsf/core"
	  xmlns:composite="http://xmlns.jcp.org/jsf/composite">
	<composite:interface>
		<composite:attribute name="tickRenderer" required="true" type="org.plotfaces.renderer.AxisTickRenderer"/>
		<composite:attribute name="collapseHandler" required="true" type="org.plotfacesdemo.CollapseHandler"/>
		<composite:attribute name="plot" required="true" type="java.lang.String"/>
	</composite:interface>

    <composite:implementation>

		<!--
			All message resources should have the _axisTickRenderer suffix.
		-->

		<p:panel id="axisTickRenderer" closable="false" toggleable="true" collapsed="#{not cc.attrs.collapseHandler.isVisible('axisTickRenderer')}" header="#{msg.axisTickRenderer}">
			<p:ajax event="toggle" listener="#{cc.attrs.collapseHandler.handleToggle}" />
			<p:panelGrid id="axisTickRendererGrid" columns="3">
				<h:panelGroup>
					#{msg.mark_axisTickRenderer}
				</h:panelGroup>
				<h:panelGroup>
					<p:selectOneMenu value="#{cc.attrs.tickRenderer.mark}" rendered="#{cc.attrs.tickRenderer.mark != null}">
						<f:selectItems value="#{enumTypes.axisTickMarks}"/>
						<p:ajax update="axisTickRendererGrid #{cc.attrs.plot}"/>
					</p:selectOneMenu>

					<p:commandButton value="#{msg.initialize}" rendered="#{cc.attrs.tickRenderer.mark == null}" update="axisTickRendererGrid #{cc.attrs.plot}">
						<f:setPropertyActionListener target="#{cc.attrs.tickRenderer.mark}" value="outside" />
					</p:commandButton>
					<p:commandButton value="#{msg.reset}" rendered="#{cc.attrs.tickRenderer.mark != null}" update="axisTickRendererGrid #{cc.attrs.plot}">
						<f:setPropertyActionListener target="#{cc.attrs.tickRenderer.mark}" value="#{null}" />
					</p:commandButton>
				</h:panelGroup>
				<h:panelGroup>
					#{msg.mark_axisTickRenderer_notes}
				</h:panelGroup>

				<h:panelGroup>
					#{msg.showMark_axisTickRenderer}
				</h:panelGroup>
				<h:panelGroup>
					<p:selectBooleanButton offLabel="#{msg.hidden}" onLabel="#{msg.shown}" value="#{cc.attrs.tickRenderer.showMark}" rendered="#{cc.attrs.tickRenderer.showMark != null}">
						<p:ajax update="#{cc.attrs.plot}"/>
					</p:selectBooleanButton>

					<p:commandButton value="#{msg.initialize}" actionListener="#{cc.attrs.tickRenderer.setShowMark( true )}" rendered="#{cc.attrs.tickRenderer.showMark == null}" update="axisTickRendererGrid #{cc.attrs.plot}"/>
					<p:commandButton value="#{msg.reset}" rendered="#{cc.attrs.tickRenderer.showMark != null}" update="axisTickRendererGrid #{cc.attrs.plot}">
						<f:setPropertyActionListener target="#{cc.attrs.tickRenderer.showMark}" value="#{null}" />
					</p:commandButton>
				</h:panelGroup>
				<h:panelGroup>
					#{msg.showMark_axisTickRenderer_notes}
				</h:panelGroup>

				<h:panelGroup>
					#{msg.showGridline_axisTickRenderer}
				</h:panelGroup>
				<h:panelGroup>
					<p:selectBooleanButton offLabel="#{msg.hidden}" onLabel="#{msg.shown}" value="#{cc.attrs.tickRenderer.showGridline}" rendered="#{cc.attrs.tickRenderer.showGridline != null}">
						<p:ajax update="#{cc.attrs.plot}"/>
					</p:selectBooleanButton>

					<p:commandButton value="#{msg.initialize}" actionListener="#{cc.attrs.tickRenderer.setShowGridline( true )}" rendered="#{cc.attrs.tickRenderer.showGridline == null}" update="axisTickRendererGrid #{cc.attrs.plot}"/>
					<p:commandButton value="#{msg.reset}" rendered="#{cc.attrs.tickRenderer.showGridline != null}" update="axisTickRendererGrid #{cc.attrs.plot}">
						<f:setPropertyActionListener target="#{cc.attrs.tickRenderer.showGridline}" value="#{null}" />
					</p:commandButton>
				</h:panelGroup>
				<h:panelGroup>
					#{msg.showGridline_axisTickRenderer_notes}
				</h:panelGroup>

				<h:panelGroup>
					#{msg.isMinorTick_axisTickRenderer}
				</h:panelGroup>
				<h:panelGroup>
					<p:selectBooleanButton offLabel="#{msg.no}" onLabel="#{msg.yes}" value="#{cc.attrs.tickRenderer.isMinorTick}" rendered="#{cc.attrs.tickRenderer.isMinorTick != null}">
						<p:ajax update="#{cc.attrs.plot}"/>
					</p:selectBooleanButton>

					<p:commandButton value="#{msg.initialize}" actionListener="#{cc.attrs.tickRenderer.setIsMinorTick( true )}" rendered="#{cc.attrs.tickRenderer.isMinorTick == null}" update="axisTickRendererGrid #{cc.attrs.plot}"/>
					<p:commandButton value="#{msg.reset}" rendered="#{cc.attrs.tickRenderer.isMinorTick != null}" update="axisTickRendererGrid #{cc.attrs.plot}">
						<f:setPropertyActionListener target="#{cc.attrs.tickRenderer.isMinorTick}" value="#{null}" />
					</p:commandButton>
				</h:panelGroup>
				<h:panelGroup>
					#{msg.isMinorTick_axisTickRenderer_notes}
				</h:panelGroup>

				<h:panelGroup>
					#{msg.size_axisTickRenderer}
				</h:panelGroup>
				<h:panelGroup>
					<p:inputText value="#{cc.attrs.tickRenderer.size}" rendered="#{cc.attrs.tickRenderer.size != null}">
						<p:ajax update="#{cc.attrs.plot}"/>
						<f:convertNumber/>
					</p:inputText>

					<p:commandButton value="#{msg.initialize}" action="#{cc.attrs.tickRenderer.setSize( 4 )}" rendered="#{cc.attrs.tickRenderer.size == null}" update="axisTickRendererGrid #{cc.attrs.plot}"/>
					<p:commandButton value="#{msg.reset}" rendered="#{cc.attrs.tickRenderer.size != null}" update="axisTickRendererGrid #{cc.attrs.plot}">
						<f:setPropertyActionListener target="#{cc.attrs.tickRenderer.size}" value="#{null}" />
					</p:commandButton>
				</h:panelGroup>
				<h:panelGroup>
					#{msg.size_axisTickRenderer_notes}
				</h:panelGroup>

				<h:panelGroup>
					#{msg.markSize_axisTickRenderer}
				</h:panelGroup>
				<h:panelGroup>
					<p:inputText value="#{cc.attrs.tickRenderer.markSize}" rendered="#{cc.attrs.tickRenderer.markSize != null}">
						<p:ajax update="#{cc.attrs.plot}"/>
						<f:convertNumber/>
					</p:inputText>

					<p:commandButton value="#{msg.initialize}" action="#{cc.attrs.tickRenderer.setMarkSize( 6 )}" rendered="#{cc.attrs.tickRenderer.markSize == null}" update="axisTickRendererGrid #{cc.attrs.plot}"/>
					<p:commandButton value="#{msg.reset}" rendered="#{cc.attrs.tickRenderer.markSize != null}" update="axisTickRendererGrid #{cc.attrs.plot}">
						<f:setPropertyActionListener target="#{cc.attrs.tickRenderer.markSize}" value="#{null}" />
					</p:commandButton>
				</h:panelGroup>
				<h:panelGroup>
					#{msg.markSize_axisTickRenderer_notes}
				</h:panelGroup>

				<h:panelGroup>
					#{msg.showTicks_axisTickRenderer}
				</h:panelGroup>
				<h:panelGroup>
					<p:selectBooleanButton offLabel="#{msg.hidden}" onLabel="#{msg.shown}" value="#{cc.attrs.tickRenderer.show}" rendered="#{cc.attrs.tickRenderer.show != null}">
						<p:ajax update="#{cc.attrs.plot}"/>
					</p:selectBooleanButton>

					<p:commandButton value="#{msg.initialize}" actionListener="#{cc.attrs.tickRenderer.setShow( true )}" rendered="#{cc.attrs.tickRenderer.show == null}" update="axisTickRendererGrid #{cc.attrs.plot}"/>
					<p:commandButton value="#{msg.reset}" rendered="#{cc.attrs.tickRenderer.show != null}" update="axisTickRendererGrid #{cc.attrs.plot}">
						<f:setPropertyActionListener target="#{cc.attrs.tickRenderer.show}" value="#{null}" />
					</p:commandButton>
				</h:panelGroup>
				<h:panelGroup>
					#{msg.showTicks_axisTickRenderer_notes}
				</h:panelGroup>

				<h:panelGroup>
					#{msg.showLabel_axisTickRenderer}
				</h:panelGroup>
				<h:panelGroup>
					<p:selectBooleanButton offLabel="#{msg.hidden}" onLabel="#{msg.shown}" value="#{cc.attrs.tickRenderer.showLabel}" rendered="#{cc.attrs.tickRenderer.showLabel != null}">
						<p:ajax update="#{cc.attrs.plot}"/>
					</p:selectBooleanButton>

					<p:commandButton value="#{msg.initialize}" actionListener="#{cc.attrs.tickRenderer.setShowLabel( true )}" rendered="#{cc.attrs.tickRenderer.showLabel == null}" update="axisTickRendererGrid #{cc.attrs.plot}"/>
					<p:commandButton value="#{msg.reset}" rendered="#{cc.attrs.tickRenderer.showLabel != null}" update="axisTickRendererGrid #{cc.attrs.plot}">
						<f:setPropertyActionListener target="#{cc.attrs.tickRenderer.showLabel}" value="#{null}" />
					</p:commandButton>
				</h:panelGroup>
				<h:panelGroup>
					#{msg.showLabel_axisTickRenderer_notes}
				</h:panelGroup>

				<h:panelGroup>
					#{msg.formatter_axisTickRenderer}
				</h:panelGroup>
				<h:panelGroup>
					#{cc.attrs.tickRenderer.formatterOptions.rendererName}
				</h:panelGroup>
				<h:panelGroup>
					#{msg.formatter_axisTickRenderer_notes}
				</h:panelGroup>

				<h:panelGroup>
					#{msg.prefix_axisTickRenderer}
				</h:panelGroup>
				<h:panelGroup>
					<p:inputText value="#{cc.attrs.tickRenderer.prefix}" rendered="#{not empty cc.attrs.tickRenderer.prefix}">
						<p:ajax update="#{cc.attrs.plot}"/>
					</p:inputText>

					<p:commandButton value="#{msg.initialize}" action="#{cc.attrs.tickRenderer.setPrefix( 'pre' )}" rendered="#{empty cc.attrs.tickRenderer.prefix}" update="axisTickRendererGrid #{cc.attrs.plot}"/>
					<p:commandButton value="#{msg.reset}" rendered="#{not empty cc.attrs.tickRenderer.prefix}" update="axisTickRendererGrid #{cc.attrs.plot}">
						<f:setPropertyActionListener target="#{cc.attrs.tickRenderer.prefix}" value="#{null}" />
					</p:commandButton>
				</h:panelGroup>
				<h:panelGroup>
					#{msg.prefix_axisTickRenderer_notes}
				</h:panelGroup>

				<h:panelGroup>
					#{msg.formatString_axisTickRenderer}
				</h:panelGroup>
				<h:panelGroup>
					<p:inputText value="#{cc.attrs.tickRenderer.formatString}" rendered="#{not empty cc.attrs.tickRenderer.formatString}">
						<p:ajax update="#{cc.attrs.plot}"/>
					</p:inputText>

					<p:commandButton value="#{msg.initialize}" action="#{cc.attrs.tickRenderer.setFormatString( '%03d' )}" rendered="#{empty cc.attrs.tickRenderer.formatString}" update="axisTickRendererGrid #{cc.attrs.plot}"/>
					<p:commandButton value="#{msg.reset}" rendered="#{not empty cc.attrs.tickRenderer.formatString}" update="axisTickRendererGrid #{cc.attrs.plot}">
						<f:setPropertyActionListener target="#{cc.attrs.tickRenderer.formatString}" value="#{null}" />
					</p:commandButton>
				</h:panelGroup>
				<h:panelGroup>
					#{msg.formatString_axisTickRenderer_notes}
				</h:panelGroup>

				<h:panelGroup>
					#{msg.fontFamily_axisTickRenderer}
				</h:panelGroup>
				<h:panelGroup>
					<p:inputText value="#{cc.attrs.tickRenderer.fontFamily}" rendered="#{not empty cc.attrs.tickRenderer.fontFamily}">
						<p:ajax update="#{cc.attrs.plot}"/>
					</p:inputText>

					<p:commandButton value="#{msg.initialize}" action="#{cc.attrs.tickRenderer.setFontFamily( 'Times New Roman' )}" rendered="#{empty cc.attrs.tickRenderer.fontFamily}" update="axisTickRendererGrid #{cc.attrs.plot}"/>
					<p:commandButton value="#{msg.reset}" rendered="#{not empty cc.attrs.tickRenderer.fontFamily}" update="axisTickRendererGrid #{cc.attrs.plot}">
						<f:setPropertyActionListener target="#{cc.attrs.tickRenderer.fontFamily}" value="#{null}" />
					</p:commandButton>
				</h:panelGroup>
				<h:panelGroup>
					#{msg.fontFamily_axisTickRenderer_notes}
				</h:panelGroup>

				<h:panelGroup>
					#{msg.fontSize_axisTickRenderer}
				</h:panelGroup>
				<h:panelGroup>
					<p:inputText value="#{cc.attrs.tickRenderer.fontSize}" rendered="#{not empty cc.attrs.tickRenderer.fontSize}">
						<p:ajax update="#{cc.attrs.plot}"/>
					</p:inputText>

					<p:commandButton value="#{msg.initialize}" action="#{cc.attrs.tickRenderer.setFontSize( '150%' )}" rendered="#{empty cc.attrs.tickRenderer.fontSize}" update="axisTickRendererGrid #{cc.attrs.plot}"/>
					<p:commandButton value="#{msg.reset}" rendered="#{not empty cc.attrs.tickRenderer.fontSize}" update="axisTickRendererGrid #{cc.attrs.plot}">
						<f:setPropertyActionListener target="#{cc.attrs.tickRenderer.fontSize}" value="#{null}" />
					</p:commandButton>
				</h:panelGroup>
				<h:panelGroup>
					#{msg.fontSize_axisTickRenderer_notes}
				</h:panelGroup>

				<h:panelGroup>
					#{msg.textColor_axisTickRenderer}
				</h:panelGroup>
				<h:panelGroup>
					<p:colorPicker value="#{cc.attrs.tickRenderer.textColor}" rendered="#{not empty cc.attrs.tickRenderer.textColor}" mode="inline"/>
					<p:commandButton value="#{msg.update}" rendered="#{not empty cc.attrs.tickRenderer.textColor}" update="#{cc.attrs.plot}" />

					<p:commandButton value="#{msg.initialize}" action="#{cc.attrs.tickRenderer.setTextColor( 'cccccc' )}" rendered="#{empty cc.attrs.tickRenderer.textColor}" update="axisTickRendererGrid #{cc.attrs.plot}"/>
					<p:commandButton value="#{msg.reset}" rendered="#{not empty cc.attrs.tickRenderer.textColor}" update="axisTickRendererGrid #{cc.attrs.plot}">
						<f:setPropertyActionListener target="#{cc.attrs.tickRenderer.textColor}" value="#{null}" />
					</p:commandButton>
				</h:panelGroup>
				<h:panelGroup>
					#{msg.textColor_axisTickRenderer_notes}
				</h:panelGroup>

				<h:panelGroup>
					#{msg.escapeHTML_axisTickRenderer}
				</h:panelGroup>
				<h:panelGroup>
					<p:selectBooleanButton offLabel="#{msg.no}" onLabel="#{msg.yes}" value="#{cc.attrs.tickRenderer.escapeHTML}" rendered="#{cc.attrs.tickRenderer.escapeHTML != null}">
						<p:ajax update="#{cc.attrs.plot}"/>
					</p:selectBooleanButton>

					<p:commandButton value="#{msg.initialize}" actionListener="#{cc.attrs.tickRenderer.setEscapeHTML( true )}" rendered="#{cc.attrs.tickRenderer.escapeHTML == null}" update="axisTickRendererGrid #{cc.attrs.plot}"/>
					<p:commandButton value="#{msg.reset}" rendered="#{cc.attrs.tickRenderer.escapeHTML != null}" update="axisTickRendererGrid #{cc.attrs.plot}">
						<f:setPropertyActionListener target="#{cc.attrs.tickRenderer.escapeHTML}" value="#{null}" />
					</p:commandButton>
				</h:panelGroup>
				<h:panelGroup>
					#{msg.escapeHTML_axisTickRenderer_notes}
				</h:panelGroup>
			</p:panelGrid>
		</p:panel>
	</composite:implementation>
</html>

